# Description: to do
# Author: chengzhen
# Date: 2021/9/28 8:20 下午
# Debug the code, debug the world!

""" 1.使用print方式进行输出（输出的目的地是文件）"""
fp = open("/Users/didi/Documents/codes/python-ptn/module2_projects/demo2_samples/sample1.txt", "w", encoding="utf-8")
print('奋斗成就更好的你', file=fp)
fp.close()

""" 2.使用文件读写方式 """
with open("/Users/didi/Documents/codes/python-ptn/module2_projects/demo2_samples/sample1.txt", "a+", encoding="utf-8") as wf:
    wf.write("奋斗成就更好的你")
